package com.cy.dda.web.comm;

import com.cy.dda.comm.utils.JsonObjectMapper;
import com.cy.dda.model.Result;
import com.cy.dda.model.dto.mall.PushLoanOrderInfoToDdaDTO;
import com.cy.dda.service.goodsdiligencing.GoodsDiligencingService;
import com.cy.dda.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Description mall 商城控制器
 * @Author tanyilin
 * @Date 2019/8/22 16:55
 */
@Slf4j
@RestController
@RequestMapping("/gateway/mall")
@Api(tags = "mall 商城控制器")
public class MallController extends BaseController {

    @Autowired
    private GoodsDiligencingService goodsDiligencingService;

    @ApiOperation("马先生商城mall放款成功订单数据推送")
    @PostMapping("/pushLoanOrderInfo")
    public Result pushLoanOrderInfo(@RequestBody PushLoanOrderInfoToDdaDTO pushLoanOrderInfoToDdaDTO) {

        log.info("订单数据：{}", JsonObjectMapper.toJson(pushLoanOrderInfoToDdaDTO));

        //新增家具尽调案件
        goodsDiligencingService.addGoodsDiligencing(pushLoanOrderInfoToDdaDTO);

        return ok();
    }

}
